<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<%
	String path = request.getContextPath();
	String basepath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<script type="text/javascript" src="<%=basepath %>/jquery/jquery-1.4.4.min.js"></script>

<link href="<%=basepath %>/CSS/displaytag.css" rel="stylesheet" type="text/css" />
<style type="text/css">
			body {
				font-size: 10pt;
			}
			.listView th {
				font: bold 12px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
				color: #4f6b72;
				border: 1px solid #97c8ff;
				letter-spacing: 2px;
				text-transform: uppercase;
				text-align: left;
				padding: 6px 11px;
				background: #b9e6fd  no-repeat;
			}
			.listView tr {
			 background-color:expression(this.rowIndex%2==0 ? "#F8F8F8":"#95bce2");
			 cursor:hand;
			}
			.listView td {
				border: 1px solid #97c8ff;
				font-size:12px;
				color: #4f6b72;
				padding: 6px 11px;   
				border-bottom: 1px solid #95bce2;   
			}     
			tr.over td {   
				background: yellow;
			}
		</style>
		<script>
			$(document).ready(function(){
				$("tr").mouseover(function(){
					$(this).addClass("over");
				}).mouseout(function(){
					$(this).removeClass("over");
				})
			});
		</script>
				
 
    
		
		<c:if test="${zhtj==null}">
		<script>
		window.location.href="<%=basepath%>initZongheTongjizhuanjiaAction";
		</script>
		</c:if>

	 <!-- ajax异步加载二级联动菜单 -->
 <script type="text/javascript">
  //创建连接，判断浏览器 
    var http_request=false; 
    function createXMLHttpRequest()
    { 
	    if(window.XMLHttpRequest)
	    { 
	      XMLHttpReq=new XMLHttpRequest(); //创建对象对应不同的浏览器
	    } 
	    else if(window.ActiveXObject)
	    { 
		      try
		      { 
		         XMLHttpReq=new ActiveXObject("Msxml2.XMLHTTP"); 
		      }
		      catch(e)
		      { 
		
			      try
			      { 
			         XMLHttpReq=new ActiveXObject("Microsoft.XMLHTTP"); 
			      }
			      catch(e)
			      { 
			
			      } 
	
	        } 
	    } 

    }
    
//onchange事件 
/*地区*/
    function changeSyscode()
    {
    //当第一个下拉框的选项发生改变时调用该函数
    var sysocode=$('#sysocode').val();
    
    sendRequest("<%=basepath%>ajaxZongheTongjizhuanjiaAction?sysocode="+sysocode); //发送参数到SERVLET
    } 
    /*医院*/
     function changeHospital()
    {
    //当第一个下拉框的选项发生改变时调用该函数
    var hospital=$("#hospital").find("option:selected").text()
    sendRequestHospital("<%=basepath%>ajaxZongheTongji01zhuanjiaAction?hospital="+hospital); //发送参数到SERVLET
    } 
    /*科室*/
    function changeKeshi()
    {
       //当第一个下拉框的选项发生改变时调用该函数
    var keshi=$("#keshi").find("option:selected").text()
    sendRequestKeshi("<%=basepath%>ajaxZongheTongji02zhuanjiaAction?keshi="+keshi); //发送参数到SERVLET
    }
    
  
    //发送地区请求 
    function sendRequest(url)
     { //发送函数
     createXMLHttpRequest(); 
     XMLHttpReq.open("GET",url,true); 
     XMLHttpReq.onreadystatechange=progessRequest;//调用相关的XML接受函数 
     XMLHttpReq.send(null); 
    } 
 //发送医院请求 
    function sendRequestHospital(url)
     { //发送函数
     createXMLHttpRequest(); 
     XMLHttpReq.open("GET",url,true); 
     XMLHttpReq.onreadystatechange=progessRequestHospital;//调用相关的XML接受函数 
     XMLHttpReq.send(null); 
    } 
     //发送科室请求 
    function sendRequestKeshi(url)
     { //发送函数
     createXMLHttpRequest(); 
     XMLHttpReq.open("GET",url,true); 
     XMLHttpReq.onreadystatechange=progessRequestKeshi;//调用相关的XML接受函数 
     XMLHttpReq.send(null); 
    } 
        //发送专家请求 
    function  sendRequestZhuanjia(url)
     { //发送函数
       createXMLHttpRequest(); 
       XMLHttpReq.open("GET",url,true); 
       XMLHttpReq.onreadystatechange=progessRequestZhuanjia;//调用相关的XML接受函数 
       XMLHttpReq.send(null); 
    }
    
     
//判断地区接收请求 
    function progessRequest()
    { 
	    if(XMLHttpReq.readyState==4)
	    { 
	      if(XMLHttpReq.status==200)
	   	 { 
	         var xmlDoc=XMLHttpReq.responseXML; //获取返回的XML文档
	         var citys=xmlDoc.getElementsByTagName("hospital");//获取XML节点
	         var obj=document.getElementById("hospital");//获取第二级菜单的对象
	   		 if(obj!=null)
	   			 {      //如果不为空就置空 
	     		 obj.options.length=0; 
	    		} 
	      for(var i=0;i<citys.length;i++)
	      {//用循环给select中加值 
	         var xValue = citys[i].childNodes[0].firstChild.nodeValue;
	         var xText = citys[i].childNodes[1].firstChild.nodeValue;
	         var option = new Option(xText, xValue);
	     	 try
	      		{
	         	obj.add(option);
	     		 }catch(e){}
	
	      		} 
	    }
	    else
	    { 
	    alert( "请求异常"+XMLHttpReq.responseText); 
	    } 
	    } 
   } 
   //判断医院接收请求 
    function progessRequestHospital()
    { 
	    if(XMLHttpReq.readyState==4)
	    { 
	      if(XMLHttpReq.status==200)
	   	 { 
	         var xmlDoc=XMLHttpReq.responseXML; //获取返回的XML文档
	         var citys=xmlDoc.getElementsByTagName("keshi");//获取XML节点
	         var obj=document.getElementById("keshi");//获取第二级菜单的对象
	   		 if(obj!=null)
	   			 {      //如果不为空就置空 
	     		 obj.options.length=0; 
	    		} 
	      for(var i=0;i<citys.length;i++)
	      {//用循环给select中加值 
	         var xValue = citys[i].childNodes[0].firstChild.nodeValue;
	         var xText = citys[i].childNodes[1].firstChild.nodeValue;
	         var option = new Option(xText, xValue);
	     	 try
	      		{
	         	obj.add(option);
	     		 }catch(e){}
	
	      		} 
	    }
	    else
	    { 
	    alert( "请求异常"+XMLHttpReq.responseText); 
	    } 
	    } 
   } 
    //判断科室接收请求 
    function progessRequestKeshi()
    { 
	    if(XMLHttpReq.readyState==4)
	    { 
	      if(XMLHttpReq.status==200)
	   	 { 
	         var xmlDoc=XMLHttpReq.responseXML; //获取返回的XML文档
	         var citys=xmlDoc.getElementsByTagName("zhuanjia");//获取XML节点
	         var obj=document.getElementById("zhuanjia");//获取第二级菜单的对象
	   		 if(obj!=null)
	   			 {      //如果不为空就置空 
	     		 obj.options.length=0; 
	    		} 
	      for(var i=0;i<citys.length;i++)
	      {//用循环给select中加值 
	         var xValue = citys[i].childNodes[0].firstChild.nodeValue;
	         var xText = citys[i].childNodes[1].firstChild.nodeValue;
	         var option = new Option(xText, xValue);
	     	 try
	      		{
	         	obj.add(option);
	     		 }catch(e){}
	
	      		} 
	    }
	    else
	    { 
	    alert( "请求异常"+XMLHttpReq.responseText); 
	    } 
	    } 
   } 
 
  </script>
  <script type="text/javascript">
  function zhuanjia()
    {
        var value=$("#zhuanjia").find("option:selected").text();
	    window.location.href="<%=basepath%>ajaxZhuanjiakeshiAction?zhuanjia="+value; 
	   
    }
  
  </script>
</head>
<body>
   <select onchange="" id="zjia" name="zjia" style="width:200px;background-color: #E2FFD7">
    	   <option>选择时间</option>
 		   <option>上午</option>
 		   <option>下午</option>
 		   <option>全天</option>
    	   </select><br/>
    	   <select onChange="changeSyscode()" id="sysocode" name="sysocode" style="width:200px;background-color: #E2FFD7">
    	   <option>选择地区</option>
    	   <c:forEach items="${syss}" var="kall">
    	   <option value="${kall.name }">${kall.name }</option>
    	   </c:forEach>
    	   </select>
    	   <br/>
    	   <select onChange="changeHospital()" id="hospital" name="hospital" style="width:200px;background-color: #E2FFD7">
    	   <option>选择医院</option>
    	   </select><br/>
 <select onChange="changeKeshi()" id="keshi" name="keshi" style="width:200px;background-color: #E2FFD7">
    	   <option>选择科室</option>
    	   </select>
    	<br/>
 <select onchange="zhuanjia()" id="zhuanjia" name="zhuanjia" style="width:200px;background-color: #E2FFD7">
    	   <option>选择专家</option>
 </select>
    	 
    	 
<div class="displayTable">

		<display:table name="${zhtj}" id="row" pagesize="8" export="false" class="displaytag">
		
			<display:column title="序号" sortable="true" headerClass="sortable" style="text-align:center;"> 
				${row.id }
			</display:column>
			<display:column title="地区" sortable="true" headerClass="sortable" style="text-align:center;"> 
				${row.keshi.hospital.syscode.name}
			</display:column>
			<display:column title="医院" sortable="true" headerClass="sortable" style="text-align:center;"> 
				${row.keshi.hospital.name}
			</display:column>
			<display:column title="科室" sortable="true" headerClass="sortable" style="text-align:center;"> 
				${row.keshi.name}
			</display:column>
			<display:column title="专家" sortable="true" headerClass="sortable" style="text-align:center;"> 
				${row.name }
			</display:column>
			<display:column title="预约" sortable="true" headerClass="sortable" style="text-align:center;"> 
					${row.yuyue }
			</display:column>
			<display:column title="取消" sortable="true" headerClass="sortable" style="text-align:center;"> 
			0
			</display:column>
			<display:column title="点击率" sortable="true" headerClass="sortable" style="text-align:center;"> 
			0
			</display:column>
</display:table>  		
	</div>




</body>
</html>